#-*-coding:utf-8 -*-
__author__ = 'Perry'

class Base(object):

	def __init__(self, appium_driver):
		self.driver = appium_driver

	def find_element(self, loc):
		try:
			return self.driver.find_element(*loc)
		except Exception as e:
			print("element not found")

	def find_elements(self, loc):
		try:
			return self.driver.find_elements(*loc)
		except Exception as e:
			print("element not found")

	def send_keys(self, value, loc):
		self.find_element(loc).send_keys(value)

	def click(self, loc):
		self.find_element(loc).click()